package com.android.openapp.data;

import java.util.LinkedHashMap;

import com.socrata.data.View;
import com.socrata.data.View.Row;

public class NLStorici extends Place {

	Row nlstorico;
	
	LinkedHashMap<String, Object> coord;
	
	@SuppressWarnings("unchecked")
	public NLStorici(Row storico) {
		super.setMetadata(Place.listmetadati.get(4));
		super.setRow(storico);
		
		super.setMapData(super.getRow().getDataFieldsForSerialization());
		 
		 //System.out.println(data);
		coord=(LinkedHashMap<String, Object>) super.getRow().getDataField(View.getColByDataType(super.getMetadata(), "location"));
		super.setCoord((String) coord.get("latitude"), (String) coord.get("longitude"));
		
		 
		
	}
	
	
	@Override
	public String getDenominazione() {
		return super.getStringValue("INSEGNA");
	}

	@Override
	public String getTipologia() {
		return getStringValue("DEN_IMPRES");
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getAddress() {
		StringBuilder builder = new StringBuilder();
		builder.append(getStringValue("INDIR_ORIG")).
			append(", ").
			append(getStringValue("ZIP")).
			append(", ").
			append(getStringValue("COMUNE")).
			append(", ").
			append(getStringValue("PR"));
		return builder.toString();
	}


	@Override
	public String getContactInfo() {
		return null; //non abbiamo info
	}

}
